<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"  %>
<html>
<head>
    <title>Test eventBus</title>
</head>
<body>
<h2>this is Test eventBus Page...</h2>
<script type="text/javascript" src="js/eventBus.js"></script>
<script type="text/javascript">

    var eventBus = new EventBus();

    function testObj(){
        eventBus.obj.set('event1',function(){
            console.log('event1');
        });
        eventBus.obj.set('event1',function(){
            console.log('event2');
        });
        eventBus.obj.set('event3',function(){
            console.log('event3');
        });

        eventBus.obj.get('event1');
    }

    function testArr() {
        eventBus.arr.push('event1',function(){
            console.log('event1');
        });
        eventBus.arr.push('event1',function(){
            console.log('event2');
        });
        eventBus.arr.push('event3',function(){
            console.log('event3');
        });

        eventBus.arr.pop('event1');
    }

    //测试obj
    testObj();
    //测试arr
    testArr();

</script>
</body>
</html>
